package com.rocky.crm.pojo;

import java.io.Serializable;

/**
 * product
 *
 * @author
 */
public class Product implements Serializable {
	/**
	 * 序号
	 */
	private Integer id;

	/**
	 * 产品名称
	 */
	private String name;

	/**
	 * 仓库地址
	 */
	private String location;

	/**
	 * 型号
	 */
	private String version;

	/**
	 * 单位
	 */
	private String unit;

	/**
	 * 单价
	 */
	private Double price;

	/**
	 * 库存
	 */
	private Integer repertory;

	/**
	 * 备注
	 */
	private String remarks;

	private Integer categoryId;

	private Category category;

	private static final long serialVersionUID = 1L;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Integer getRepertory() {
		return repertory;
	}

	public void setRepertory(Integer repertory) {
		this.repertory = repertory;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public Integer getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}


	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		Product other = (Product) that;
		return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
				&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
				&& (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()))
				&& (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()))
				&& (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
				&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
				&& (this.getRepertory() == null ? other.getRepertory() == null : this.getRepertory().equals(other.getRepertory()))
				&& (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()))
				&& (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
		result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
		result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
		result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode());
		result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
		result = prime * result + ((getRepertory() == null) ? 0 : getRepertory().hashCode());
		result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
		result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
		return result;
	}

	@Override
	public String toString() {
		return "Product [id=" + id + ", name=" + name + ", location=" + location + ", version=" + version + ", unit="
				+ unit + ", price=" + price + ", repertory=" + repertory + ", remarks=" + remarks + ", categoryId="
				+ categoryId + ", category=" + category + "]";
	}


}